import {HttpHelper} from "df_ng_mall_services";
import {PurchaseLimit} from "./domains";
import {Injectable} from "@angular/core";
@Injectable()
export class PurchaseLimitService{
    private limitUrl:string="rest/purchase-limits";
    constructor(private helper:HttpHelper){

    }

    purchaseLimits():Promise<PurchaseLimit[]>{
        return this.helper.getJson<PurchaseLimit[]>(this.limitUrl);
    }

    addLimit(limit:PurchaseLimit){
        return this.helper.postToJson(this.limitUrl,limit);
    }
}